package com.ggdog.blog.Services.impl;

import com.ggdog.blog.DAO.ProjectDAO;
import com.ggdog.blog.POJO.Project;
import com.ggdog.blog.Services.ProjectServices;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class ProjectServicesImpl implements ProjectServices {
    @Autowired
     ProjectDAO projectDAO;
    @Override
    public int addProject(String projectName, String projectDescription, String projectUrl, String projectImageUrl, String projectGitUrl, String projectType) {
        return projectDAO.addProject(projectName,projectDescription,projectUrl,projectImageUrl,projectGitUrl,projectType);
    }

    @Override
    public List<Project> getAllProject() {
        List<Project> projects = projectDAO.getAllProject();
        if (projects==null){
            System.out.println("获取失败");
            return null;
        }else{
            System.out.println("获取成功");
            return projects;
        }

    }
}
